# Maintainer: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
pkgname=pulseview
pkgver=0.4.2
pkgrel=8
pkgdesc="QT-based GUI frontend for sigrok"
url="https://sigrok.org/wiki/PulseView"
makedepends="
	boost-dev
	cmake
	glibmm-dev
	libserialport-dev
	libsigrok-dev
	libsigrokdecode-dev
	qt5-qtbase-dev
	qt5-qtsvg-dev
	qt5-qttools-dev
	samurai
	"
# Without qt5-qtsvg some icons in the GUI are missing
depends="qt5-qtsvg"
arch="all !riscv64" # fails to build on riscv64
license="GPL-3.0-only"
source="http://sigrok.org/download/source/pulseview/pulseview-$pkgver.tar.gz
	https://github.com/sigrokproject/pulseview/commit/ae726b70a7ada9a4be5808e00f0c951318479684.patch
	fix-build-template.patch
	remove-broken-testcases.patch
	"
subpackages="$pkgname-doc"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_BINDIR=/usr/bin \
		-DCMAKE_INSTALL_SBINDIR=/usr/sbin \
		-DCMAKE_INSTALL_SYSCONFDIR=/etc/hiawatha \
		-DCMAKE_INSTALL_LIBDIR=/usr/lib \
		-DCMAKE_INSTALL_MANDIR=/usr/share/man \
		-DENABLE_TESTS=y \
		-DENABLE_DECODE=y
	cmake --build build
}

check() {
	ctest --output-on-failure --test-dir build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
79f653c9faad021c03b59b4a519b594190d5558dfb9be60cabcc2a35e991e66b733b337fec58a9248699e7aef0df3be1472c81f93274b25cec1fc6b73f8f033b  pulseview-0.4.2.tar.gz
e115c29151474d5dc905042ee699542abdcc9db523d45595cf0386f0efb9523b292536972074536cb330ede90b41e1edd591888bceb5155b49657937f87e9087  ae726b70a7ada9a4be5808e00f0c951318479684.patch
5af1ba2eb5de6b899d58fc87ee4f69a1ffd580ca81ad6be4fc0078692f688ebb17986bb860b03336d3caba0ba312cf1252194eacd464a697f70cc16910a3f177  fix-build-template.patch
f96d8ad1f80d068aa367282656f654313261ae5918c00347d14d3290798d48361d452d3b6bd1f67ebfa516e04fc5b3cbea0cdec0995e691045cc0d025b9f875b  remove-broken-testcases.patch
"
